package niso;

import java.util.ArrayList;

public class Invoice {

	
	private String ReceiptNum,CustomerName,RecordedDate;
	private double balance;
	private ArrayList<Sale> Sales;
	
	
	
	public Invoice(String InID,String Name,String date,double bal){
		ReceiptNum=InID;
                if(Name!=null||Name.length()<=0)
                    CustomerName=Name;
                else CustomerName="";
		RecordedDate=date;
		balance=bal;
		Sales=new ArrayList<Sale>();
	}
	

	public ArrayList<Sale> getSales() {return Sales;}
	public void addSale(Sale S){Sales.add(S);}
	public double getBalance(){return balance;}
	
	
	public void setBalance(double cost){ balance=cost;}
	public void setSales(ArrayList<Sale> sales) {Sales = sales;}
	public String getReceiptNum() {return ReceiptNum;}
	public void setReceiptNum(String receiptNum) {ReceiptNum = receiptNum;}
	public String getCustomerName() {return CustomerName;}
	public void setCustomerName(String customerName) {CustomerName = customerName;}
	public String getRecordedDate() {return RecordedDate;}
	public void setRecordedDate(String recordedDate) {RecordedDate = recordedDate;}

        public double getTotal(){
            double sum=0;
            for(int ctr=0;ctr<Sales.size();ctr++)
                sum+=Sales.get(ctr).getPrice();
            return sum;
        }
}
